﻿FlyTalk.views.SearchView = Ext.extend(Ext.TabPanel, {

    indicator: true,
    fullscreen: true,
    layout: 'card', 
        
    items: [
        {
            title: 'Tab 1',
            html : '1',
            cls  : 'card1',     
        },
        {
            title: 'Tab 2',
            html : '2',
            cls  : 'card2',
                        
                                
        },
    ],
    tabBar:{
        dock: 'bottom', // will put the menu on the bottom of the screen
        
                layout:{
                        type: 'hbox',
            pack: 'center' // this will center the menu
        },
                //height: 35,
                //ui: 'small',
                
    },    
		
		
		
    initComponent: function () {
             


		this.backButton = new Ext.Button({
			text: 'Back',
			ui: 'back',
			handler: this.backButtonTap,
			scope: this
		});
    	
		this.toolbar = new Ext.Toolbar({
				title: 'Search/Ask',
				doc: 'top',
				layout: 'hbox',
				items: [
					this.backButton,
					{xtype: 'spacer'},
						//this.composeButton,
				]
		});
		//this.dockedItems = [this.toolbar];
		
		Ext.apply(FlyTalk.views, {
				SearchSearchView: new FlyTalk.views.SearchSearchView(),
		//		SearchAskView: new FlyTalk.views.SearchAskView(), // ask
				
		});
		
		this.items = [
		              FlyTalk.views.SearchSearchView, 
		              //FlyTalk.views.SearchAskView
		              ];
		
		
		FlyTalk.views.SearchView.superclass.initComponent.call(this);

	},
	
	backButtonTap: function () {
        Ext.dispatch({
            controller: FlyTalk.controllers.ftController,
            action: 'openHome'
        });
    },

});